﻿@model XXN.Model.GuideModel
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>EditInfo</title>
    <link href="~/lib/layui/css/layui.css" rel="stylesheet" />
    <script src="~/lib/layui/layui.js"></script>
    <script src="~/Scripts/jquery-1.8.0.js"></script>
    <script src="~/Scripts/jquery.validate.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
    <script src="~/Scripts/jquery.validate.unobtrusive.js"></script>
</head>
<body>
    <div>
        @using (Ajax.BeginForm("EditInfo", "Guide", new AjaxOptions { OnSuccess = "EditCom" }))
        {
            @Html.HiddenFor(m => m.Guide_id)
            <div class="layui-form-item">
                @Html.LabelFor(m => m.Img_id)
                @Html.EditorFor(m => m.Img_id)
                @Html.ValidationMessageFor(m => m.Img_id)
            </div>
            <div class="layui-form-item">
                @Html.Label("商品名称")
                @Html.DropDownListFor(m => m.Pro_id,ViewData["type"] as List<SelectListItem>)
                @Html.ValidationMessageFor(m => m.Pro_id)
            </div>
            <div class="layui-form-item">
                @Html.LabelFor(m => m.Starttime)
                @Html.EditorFor(m => m.Starttime)
                @Html.ValidationMessageFor(m => m.Starttime)
            </div>
            <div class="layui-form-item">
                @Html.LabelFor(m => m.Endtime)
                @Html.EditorFor(m => m.Endtime)
                @Html.ValidationMessageFor(m => m.Endtime)
            </div>
            <div class="layui-form-item">
                @Html.LabelFor(m => m.Guide_Price)
                @Html.EditorFor(m => m.Guide_Price)
                @Html.ValidationMessageFor(m => m.Guide_Price)
            </div>
            <div class="layui-form-item">
                @Html.LabelFor(m => m.Guide_num)
                @Html.EditorFor(m => m.Guide_num)
                @Html.ValidationMessageFor(m => m.Guide_num)
            </div>
            <div>
                <button>提交</button>
            </div>
        }
    </div>
    <script>
        function EditCom(re) {
            if (re.success == true) {
                parent.layui.layer.msg(re.msg);
                //当你在iframe页面关闭自身时
                parent.layui.$("#btSearch").click();
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭
            }
            else {
                alert(re.msg);
            }
        }
    </script>
</body>
</html>
